<template>
  <div class="home">
    <!-- <van-image
      class="diagramTop-item-click"
      width="10rem"
      height="10rem"
      style="padding-left: 5rem; padding-right: 5rem; margin-top: 5rem"
      fit="cover"
      position="left"
      :src="baseImg"
    /> -->
    <div style="back"> <img src="../../assets/images/banner2@3x.png" /> </div>
    <div style="  padding-top: 2rem; padding-left: 1rem; padding-right: 1rem">
      <div @click="toRecordNew()"
        style="width:100%;height: 120px;background: #ffffff;border-radius: 16px;box-shadow: 0px 0px 20px 0px rgba(60,128,209,0.15);">
        <img style=" margin-left: 5%;margin-top:30px;float:left;width:45pt;height:45pt;"
          src="../../assets/images/icon_zizhu@3x.png" />
        <div style="line-height:120px;font-size: 15pt; border: none;float:left;margin-left: 10%;">来连自主报备</div>
      </div>
      <div @click="toRecordNewOk()"
        style="margin-top: 1rem;width:100%;height: 120px;background: #ffffff;border-radius: 16px;box-shadow: 0px 0px 20px 0px rgba(60,128,209,0.15); ">
        <img style="margin-left: 5%;margin-top:30px;float:left;width:45pt;height:45pt;"
          src="../../assets/images/icon_chaxun@3x.png" />
        <div style="line-height:120px;font-size: 15pt; border: none;float:left;margin-left: 10%;">来连报备查询</div>
      </div>
    </div>
    <!-- <van-cell-group inset>
      <van-cell-group inset>
        <van-field
          v-model="formData.queryCode"
          center
          clearable
          label="身份证号"
          placeholder="请输入身份证号进行登录"
        >
          <template #button>
            <van-button size="small" @click="shaxin()" type="primary"
              >刷新</van-button
            >
          </template>
        </van-field>
      </van-cell-group>
    </van-cell-group> -->
    <!--
    <div style="margin: 16px; display: flex">
      <van-button block type="info" @click="goToRest()">登录</van-button>
    </div> -->
  </div>
</template>

<script>
import area from '@/libs/area.json'
import {
  helpUserNewQrCode,
  editQueryCode,
  editReloadQueryCode
} from '@/api/self/help'
import { Toast, Dialog } from 'vant'
export default {
  data () {
    return {
      baseImg: '',
      notShow: true,
      formData: {
        queryCode: '',
        verifyQueryCode: '',
        certificatesNo: ''
      }
    }
  },
  mounted () {
    let url =
      'https://dalianoutbreaknew.lngov.top/railway/#/record-info?id=' +
      this.$route.query.id
    console.log('url=====,===', url)
    this.baseImg = this.$route.query.qrUrl
  },
  methods: {
    toRecordNew () {
      this.$router.push({
        name: 'record-new',
        // name: 'record-new-hc',
        query: {
          idCard: this.$route.query.idCard,
          name: this.$route.query.name,
          mobile: this.$route.query.mobile,
          cardType: this.$route.query.cardType
        }
      })
    },
    toRecordNewOk () {
      this.$router.push({
        name: 'recordNewOk',
        // name: 'recordNewOk-hc',
        query: {
          idCard: this.$route.query.idCard
        }
      })
    },
    shaxin () {
      let data = {
        certificatesNo: this.$route.query.certificatesNo,
        queryCode: this.formData.queryCode
      }
      editReloadQueryCode(data).then((res) => {
        if (res.data.errcode === 0) {
          this.formData.queryCode = res.data.data.queryCode
          this.baseImg = res.data.data.qrUrl
        } else {
          Toast.fail(res.data.errmsg)
        }
      })
    },
    goToRest () {
      this.$router.push({
        name: 'record',
        query: { id: this.$route.query.id, code: this.$route.query.code }
      })
    },
    onSubmit () {
      let data = {
        queryCode: this.formData.queryCode,
        verifyQueryCode: this.formData.verifyQueryCode,
        certificatesNo: this.$route.query.certificatesNo
      }
      editQueryCode(data).then((res) => {
        Toast.clear()
        if (res.data.errcode === 0) {
          this.notShow = false
        } else {
          Toast.fail(res.data.errmsg)
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
.bb,
.bb::before,
.bb::after {
  // position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.bb {
  width: 450px;
  height: 450px;
  margin: auto;
  /* background: url(baseImg) no-repeat 50%/70% rgba(0, 0, 0, 0.1); */
  color: #69ca62;
  // box-shadow: inset 0 0 0 1px rgba(105, 202, 98, 0.5);
}

.bb::before,
.bb::after {
  content: '';
  z-index: -1;
  margin: -5%;
  box-shadow: inset 0 0 0 2px;
  animation: clipMe 8s linear infinite;
}

.bb::before {
  animation-delay: -4s;
}

.bb:hover::after,
.bb:hover::before {
  background-color: rgba(255, 0, 0, 0.3);
}

@keyframes clipMe {

  0%,
  100% {
    clip: rect(0px, 520px, 2px, 0px);
  }

  25% {
    clip: rect(0px, 2px, 520px, 0px);
  }

  50% {
    clip: rect(518px, 520px, 520px, 0px);
  }

  75% {
    clip: rect(0px, 5100px, 520px, 500px);
  }
}
</style>
<style lang="less" scoped>
.upload-img-5 {
  margin: 5px 0 90px 0;
}

.upload-img-1 {
  margin: 5px 0 15px 0;
}

.home {
  background: CGRectMake(0, 0, 375, 667) no-repeat;
  background-size: cover;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  height: 100%;

  img {
    width: 100%;
  }

  .dialog-container {
    height: 70vh;
    overflow-y: auto;
  }

  .get-area {
    width: 100%;
    padding: 0 0.8rem;
    font-size: 0.747rem;
    color: #fff;
    background-color: #1989fa;
    border: 0.053rem solid #1989fa;
    height: 2.347rem;
    line-height: 2.347rem;
    text-align: center;
    border-radius: 0.107rem;
    cursor: pointer;
    box-sizing: border-box;
    margin-right: 10px;
  }

  /deep/.van-field__label {
    width: 8em;
  }

  /deep/.van-field__error-message {
    text-align: right;
  }

  .title {
    // font-size: 28px;
    text-indent: 20px;
    padding: 50px 0 20px;
  }

  .container {
    width: 90%;
    height: 80vh;
    overflow-y: auto;
    border: 1px solid #adadad;
    margin: auto;

    .item {
      margin: 10px;
    }
  }
}

.up-and-down {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f1f3f4;
  height: 80px;
  color: #333;
}

// .home .blue {
//   background-color: transparent;
// }
// .home .van-cell{
//  background-color: transparent;
// }
</style>
